home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Intercept
/
Visual Intercept.iso
/
sheriff.z
/
isgnrlfn.bas
< prev
next >
Wrap
BASIC Source File
|
1996-08-26
|
6KB
|
202 lines
Attribute VB_Name = "IIGeneral"
'----------------------------------------------------------------------------
' isgnrlfn.bas is a member of the Visual Intercept Visual Basic API.
' Copyright (c) 1996 Elsinore Technologies, Inc. All rights reserved.
'
' This software is protected by copyright law. Unauthorized reproduction
' or distribution of this program, or any portion of it, may result in
' severe civil or criminal penalties. If you have any questions about
' your redistribution rights, please contact Elsinore Technologies, Inc.
'
' Creator: Albert J. Lin (AJL)
' History: Created 09/17/95
'----------------------------------------------------------------------------
'----------------------------------------------------------------------------
' Visual Intercept Constants:
'----------------------------------------------------------------------------
Public Const lnIIAccountName = 32
Public Const lnIIAccountCode = 32
Public Const lnIIProjectName = 256
Public Const lnIIVersionName = 32
Public Const lnIIIncidentName = 32
Public Const lnIIUserID = 128
Public Const lnIIPassword = 32
Public Const lnIIDescription = 32767
Public Const lnIISubject = 128
Public Const lnIIDate = 64
Public Const lnIIParameter = 32
Public Const lnIIName = 32
Public Const lnIICity = 32
Public Const lnIIState = 32
Public Const lnIIAddress = 32
Public Const lnIIZipCode = 32
Public Const lnIIDepartement = 32
Public Const lnIICompany = 32
Public Const lnIITitle = 32
Public Const lnIIRegion = 32
Public Const lnIICountry = 32
Public Const lnIIPhone = 32
Public Const lnIIEMail = 128
Public Const lnIIServerName = 128
'----------------------------------------------------------------------------
' Visual Intercept Warning Codes:
'----------------------------------------------------------------------------
Public Const IE_WRN_NO_DATA = 1
Public Const IS_WRN_CANCEL = 4000
'----------------------------------------------------------------------------
' Visual Intercept Error Codes:
'----------------------------------------------------------------------------
Public Const IE_WRN_CANCEL = 2
Public Const IE_ERR_NOACCESS = -1
Public Const IE_ERR_NOPERMISSION = -2
Public Const IE_ERR_BADMEM = -3
Public Const IE_ERR_INVALID_USERID = -4
Public Const IE_ERR_INVALID_PASSWORD = -5
Public Const IE_ERR_INVALID_SERVER = -6
Public Const IE_ERR_INVALID_DATABASE = -7
Public Const IE_UNKNOWN_PARAMETER_TYPE = -8
Public Const IE_ERR_DATA_TRUNCATED = -9
Public Const IE_ERR_DATA_CHANGED = -10
Public Const IE_ERR_INVALID_ADMIN = -11
Public Const IS_ERR_ODBC_DRIVER = -4000
Public Const IS_ERR_INVALID_SYSUSERID = -4001
Public Const IS_ERR_INVALID_SYSPASSWORD = -4002
Public Const IS_ERR_NOEXIST_SERVER = -4003
'
'/**************************************************************************
' * Connection API Functions in ISAPI.
'*************************************************************************
Public Declare Function IISetAutoNotify Lib "isapi.dll" (ByVal Flag1 As Long) As Long
Public Declare Function IIPing Lib "isapi.dll" () As Long
Public Declare Function IIFreeResults Lib "isapi.dll" () As Long
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Public Function VBIITrim(text As String) As String
Dim finish As String
Dim ch As String
Dim i, ln As Integer
' we have a serious problem with trimming text.
' The strings that are sent to the Intercept Engine
' have been padded to accept the best possible
' return data and we are passing with null bytes
' which Intercept likes and knows to ignore. The
' Trim methods in VB can only trim spaces.
' You need to use this function only if your are
' trying to trim strings that are directly returned
' from the Intercept API.
ln = Len(text)
For i = 1 To ln
ch = Mid(text, i, 1)
If StrComp(ch, vbNullChar, 1) <> 0 Then
finish = finish + ch
Else
Exit For
End If
Next i
VBIITrim = finish
End Function
Public Function VBIIError(ByRef rError As Long)
Dim msg As String
If rError < 0 Then ' Visual Intercept Error
Select Case rError
Case IE_ERR_NOACCESS
msg = "IE_ERR_NOACCESS"
Case IE_ERR_NOPERMISSION
msg = "IE_ERR_NOPERMISSION"
Case IE_ERR_BADMEM
msg = "IE_ERR_BADMEM"
Case IE_ERR_INVALID_USERID
msg = "IE_ERR_INVALID_USERID"
Case IE_ERR_INVALID_PASSWORD
msg = "IE_ERR_INVALID_PASSWORD"
Case IE_ERR_INVALID_SERVER
msg = "IE_ERR_INVALID_SERVER"
Case IE_ERR_INVALID_DATABASE
msg = "IE_ERR_INVALID_DATABASE"
Case IE_UNKNOWN_PARAMETER_TYPE
msg = "IE_UNKNOWN_PARAMETER_TYPE"
Case IE_ERR_DATA_TRUNCATED
msg = "IE_ERR_DATA_TRUNCATED"
Case IE_ERR_DATA_CHANGED
msg = "IE_ERR_DATA_CHANGED"
Case IE_ERR_INVALID_ADMIN
msg = "IE_ERR_INVALID_ADMIN"
Case IS_ERR_ODBC_DRIVER
msg = "IS_ERR_ODBC_DRIVER"
Case IS_ERR_INVALID_SYSUSERID
msg = "IS_ERR_INVALID_SYSUSERID"
Case IS_ERR_INVALID_SYSPASSWORD
msg = "IS_ERR_INVALID_SYSPASSWORD"
Case IS_ERR_NOEXIST_SERVER
msg = "IS_ERR_NOEXIST_SERVER"
Case Else
msg = "Unknown Visual Intercept Error [" + Str$(rError) + "]"
End Select
If MsgBox(msg, vbOKCancel) = vbOK Then
rError = 0
End If
End If
End Function
Public Function VBIISetAutoNotify(ByRef rNotify As Long) As Long
Dim err As Long
err = IISetAutoNotify(rNotify)
VBIISetAutoNotify = err
End Function
Public Function VBIIPing() As Long
Dim err As Long
err = IIPing()
VBIIPing = err
End Function
Public Function VBIIVersion() As Long
Dim version As Long
version = IIVersion()
VBIIVersion = version
End Function
Public Function VBIIFreeResults() As Long
Dim err As Long
err = IIFreeResults()
VBIIFreeResults = err
End Function